package com.medicine.hbp.ui;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

import com.medicine.hbp.R;
import com.medicine.hbp.base.BaseActivity;
import com.medicine.hbp.uitl.MyApplication;
import com.medicine.hbp.uitl.ToastUtil;

public class ceshi extends BaseActivity{
	private EditText txt;
	private Button btn;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_ceshi);
		txt=(EditText) findViewById(R.id.edit);
		btn=(Button) findViewById(R.id.btn);
		btn.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				if(TextUtils.isEmpty(txt.getText().toString())){
					ToastUtil.showShort(ceshi.this, "还没有输入ip地址");
					return;
				}
				MyApplication.getMyApplication().setIp(txt.getText().toString());
				Intent intent=new Intent(ceshi.this,SplashActivity.class);
				ceshi.this.startActivity(intent);
				ceshi.this.finish();
			}
		});
	}

}
